package com.woniuxy.project.campus.canteen.mapper;

import com.woniuxy.project.campus.canteen.model.ProductList;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author 猫将军
 * @since 2025年02月17日
 */
@Mapper
public interface ProductListMapper extends BaseMapper<ProductList> {


    //查询大于该序列号的所有商品信息、
    @Select("select * from product_list where sort >= #{srot} and shop_id = #{shopId}")
     List<ProductList> selectBySeqGreaterThan(@Param("srot") Integer srot, @Param("shopId") Integer shopId);

    //查询所有商品的排序号中最大的对象
    @Select("select max(sort) from product_list where shop_id = #{shopId}")
    Integer selectMaxSortByShopId(@Param("shopId") Integer shopId);


}
